Fix retrying crate downloads for network errors
authorAlex Crichton <alex@alexcrichton.com>
Wed, 30 Nov 2016 00:52:20 +0000 (16:52 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 1 Dec 2016 04:43:19 +0000 (20:43 -0800)
commitdf30da0c5702cb5b2fdb0df0d96047e477646366
treef31e83c8d2f637534828d63460eefec4fdaa416b
parent80ec9e0fb7e0574493dc9a9a6891c82b6b1ce512
Fix retrying crate downloads for network errors

Previously the `with_retry` loop was a little too tight where stale state about
the sha256 and data was kept out of the loop. Instead we need to reinitialize
these on each iteration of the loop to ensure that we correctly retry by
forgetting the data we previously downloaded for an aborted download attempt.
src/cargo/sources/registry/remote.rs